
	export const http = function( url, method, data, success, loading) {
			uni.showLoading();
			let Authorization =  uni.getStorageSync("access_token");
			let headers = {
			// 	'access-token': Authorization
			}
			try {
				uni.request({
					url,
					method,
					data,
					headers,
					sslVerify: false,
					success: result => {
						uni.hideLoading();
						let pass = true
						if (result.data.code !== 0) {
							if (result.data.message == "unlogin") {
								pass = false;
								uni.switchTab({
									url: "@/login/login"
								})
							}
						}
						if (pass) {
							success(result);
						}
					},
					fail: (err) => {
						console.log('报错信息', err)
						uni.showToast({
							title: "请求失败,请稍后重试",
							icon: 'none',
						})
						uni.hideLoading();
					}
				})
			} catch (e) {
				console.log('request', e)
			}
		
		}


	

